package com.vitechinc.v3.dates;

import java.text.DateFormat;
import java.util.Date;

/**
 * Represents a period in time. The period is conceived as containing
 * the time period such that getStartDate <= date < getStopDate
 * @author BBinford
 *
 */
public class Period {
	
	private Date startDate;
	private Date stopDate;
	
	/**
	 * Constructs a new Period Object
	 * @param startDate the start date of the period
	 * @param stopDate the stop date of the period
	 */
	public Period(Date startDate, Date stopDate) {
		super();
		this.startDate = startDate;
		this.stopDate = stopDate;
	}
	/**
	 * @return a date representing the start of the period
	 */
	public Date getStartDate()
	{
		return startDate;
	}
	/**
	 * @return a date representing the end of the period, exclusive
	 */
	public Date getStopDate()
	{
		return stopDate;
	}
	
	public String toString()
	{
		DateFormat df = DateFormat.getDateInstance();
		return df.format(startDate) + " - " + df.format(stopDate);
	}
}
